(define keyfor
  (native_function "
    Proc.new do |arguments, interpreter|
      argument1 = interpreter.evaluate(arguments[0])
      argument2 = interpreter.evaluate(arguments[1])
      index = []
      i = 0
      argument1.each do |key, value|
        if argument2 == value
          index << key
        end
      end
      if index.length == 1
        index[0]
      else
        index
      end
    end
  "))
